import Vue from 'vue'
import App from './App.vue'
import vuetify from './plugins/vuetify'
import router from './router'
import store from './store'
import axios from 'axios'

Vue.config.productionTip = false

// axios.defaults.withCredentials = true
axios.defaults.baseURL = 'http://8.130.9.234:3000/'
// axios.defaults.headers.post['Content-Type'] = 'application/json;charset=utf-8';
axios.defaults.headers.post['Access-Control-Allow-Origin'] = '*';
// 设置token
axios.interceptors.request.use(function (config) {
  if (localStorage.token) {
    config.headers.Authorization = 'Bearer ' + localStorage.token;
  }
  return config;
});

new Vue({
  vuetify, // 使用vuetify
  router, // 使用vue router
  store, // 使用vuex
  render: h => h(App)
}).$mount('#app')